package from;

import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.image.Image;
import org.apache.wicket.markup.html.image.resource.RenderedDynamicImageResource;

import java.awt.*;

public class ImagePage extends WebPage {
    public ImagePage(){
        super();
        this.add(new Image("static","test.gif"));

        add(new Image("dynamic", new RenderedDynamicImageResource(100,100) {
            @Override
            protected boolean render(Graphics2D graphics, Attributes attributes) {
                graphics.drawString("测试",10,10);
                return true;
            }
        }));
    }
}
